package com.ctshk.sapp.order.tour.controller;

import com.ctshk.common.annotations.OperationLogAnnotation;
import com.ctshk.common.dto.Result;
import com.ctshk.common.enums.OperationLogModel;
import com.ctshk.common.enums.OperationLogType;
import com.ctshk.common.web.support.BaseController;
import com.ctshk.rpc.order.tour.dto.SeriesOrderReceiptTouristListDTO;
import com.ctshk.rpc.order.tour.req.SeriesOrderReceiptTouristListReq;
import com.ctshk.rpc.order.tour.service.ISeriesOrderReceiptTouristService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 系列团收据关联游客 前端控制器
 * </p>
 *
 * @author 谭响
 * @since 2021-02-01
 */
@Api(value="收据关联游客", tags="收据关联游客")
@RestController
@RequestMapping("/series/order/receipt/tourist")
public class SeriesOrderReceiptTouristController extends BaseController {

    @DubboReference
    private ISeriesOrderReceiptTouristService iSeriesOrderReceiptTouristService;

    @ApiOperation(value = "列表", notes = "列表（收據管理-包含旅客）")
    @OperationLogAnnotation(operModul = OperationLogModel.ORDER, operType = OperationLogType.QUERY, operTitle = "收據管理-包含旅客", operDesc = "收據管理-包含旅客")
    @PostMapping("/list")
    public Result<List<SeriesOrderReceiptTouristListDTO>> includeTourist(@RequestBody SeriesOrderReceiptTouristListReq req) {
        req.setUserId(getCurrentUser(getRequest()).getId());
        return iSeriesOrderReceiptTouristService.list(req);
    }

}
